#include "ImageHandler.h"

sf::Image prim::ImageHandler::LoadFromFile(std::string filename)
{
	// Check if we already have an image loaded with the same file
	/*for (int i = 0; i < prim::ImageHandler::Images_filenames.size(); i++)
	{
		if (prim::ImageHandler::Images_filenames[i] == filename)
		{
			// Return the image stored in the vector
			return prim::ImageHandler::Images[i];
			std::cout << "Texture with filename \"" << filename << "\" already existed in memory." << std::endl;
		}
	}*/

	// Load a new image
	sf::Image img;
	img.LoadFromFile(filename);

	// Add it to the vector
	//prim::ImageHandler::Images.push_back(img);
	//prim::ImageHandler::Images_filenames.push_back(filename);

	return img;
}